home *** CD-ROM | disk | FTP | other *** search
- Path: sydney.DIALix.oz.au!not-for-mail
- From: jussi@sydney.DIALix.oz.au (Jussi Jumppanen)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: New printf - like function, is it possible?
- Followup-To: comp.lang.c,comp.lang.c++
- Date: 31 Mar 1996 20:23:43 +1000
- Organization: DIALix Services, Sydney, Australia.
- Sender: jussi@sydney.DIALix.oz.au
- Message-ID: <4jlmff$jce$1@sydney.DIALix.oz.au>
- References: <4eqb3a$2r5@pan.otol.fi> <311240d2.593861@news.demon.co.uk>
- NNTP-Posting-Host: jussi@sydney.dialix.oz.au
-
- On 1 Feb 1996 12:18:50 GMT, tkes@rhea.otol.fi (Timo Sakari) wrote:
-
- >
- >Hi!
- >
- >Do you C-gurus have any solutions to this problem?
- >
- >I am programming under MS Windows 3.1 (this is NOT an OS spesific
- >question!)and I would like to create
- >some kind of modified print function, which syntax should be something
- >like normal printf; because in Windows printf can't be used, everything
- >printed to screen has to come through message boxes etc, and before
- >displaying anything, the string to displayed has to be formed. I have
- >created my own printing function, which wants parameters string and winID
- >to know where to put that string, something like this:
-
- This is the code I use to send output to the debug window using the
- va_list functions (compiled on BC4.5)
-
- //-- To use this function in Win31, you must load the device driver
- //-- OX.SYS or the Windows 3.1 utility DBWIN. Use DebugOut just like
- //-- printf function:
- //--
- //-- Example: DebugOut("function foo %d %s", myint, mystring);
-
- void DebugOut(char *pszFormat, ...)
- {
- char szBuffer[255];
-
- va_list arg_ptr;
-
- va_start(arg_ptr, pszFormat);
- wvsprintf(szBuffer, pszFormat, arg_ptr);
- va_end(arg_ptr);
-
- OutputDebugString(szBuffer);
- }
-
- /-----------------------------------------------------------------------/
- /- Jussi Jumppanen (jussi@sydney.dialix.oz.au) -/
- /-----------------------------------------------------------------------/
- /- Author of: Zeus for Windows, Win32 (Brief, WordStar Clone) Editor -/
- /- garbo.uwasa.fi :/windows/editor/zeusv200.zip -/
- /- SimTel.Coast.NET:/SimTel/nt/editor/ze32v200.zip -/
- /- SimTel.Coast.NET:/SimTel/win3/editor/zeusv200.zip -/
- /- http://www.coast.net/SimTel/SimTel/win3/editor/zeusv200.zip -/
- /-----------------------------------------------------------------------/
-
-
-
-